package com.imooc.distributedemo.resume.nowcoder;

import com.alibaba.druid.util.StringUtils;

import javax.script.ScriptEngine;
import javax.script.ScriptEngineManager;
import java.util.Scanner;

// 四则运算
public class CaculatorSolution {
    public static void main(String[] args) throws Exception{

        /*Scanner scanner = new Scanner(System.in);
        String input = scanner.nextLine();

        input.replace("[","(");
        input.replace("{","(");
        input.replace("]",")");
        input.replace("}",")");
        ScriptEngine scriptEngine = new ScriptEngineManager().getEngineByName("nashorn");
        System.out.println(scriptEngine.eval(input));

        System.out.println("============");*/

        Scanner scan = new  Scanner(System.in);
        String input2 = scan.nextLine();
        input2 = input2.replace("[","(");
        input2 = input2.replace("{","(");
        input2 = input2.replace("}",")");
        input2 = input2.replace("]",")");
        ScriptEngine scriptEngine2 = new ScriptEngineManager().getEngineByName("nashorn");
        System.out.println(scriptEngine2.eval(input2));



    }
}
